package com.tb.shoop.controller.config.Filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class WebConfigFilter {

    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new EncryptFilter());
        List<String> urlPatterns = new ArrayList<String>();
        urlPatterns.add("/*");
        /*urlPatterns.add("/datasource/*");*/
        registrationBean.setUrlPatterns(urlPatterns);
        //registrationBean.setOrder(1);//设置优先级
        return registrationBean;
    }
}
